<template>
  <el-form :model="form" label-width="auto" style="max-width: 600px">
      <el-form-item label="姓名">
          <el-input v-model="form.name" />
      </el-form-item>

      <el-form-item label="性别">
          <el-select v-model="form.sex" placeholder="请选择您的性别">
              <el-option label="男" value="男" />
              <el-option label="女" value="女" />
          </el-select>
      </el-form-item>

      <el-form-item label="年龄">
          <el-input v-model="form.age" />
      </el-form-item>
      <el-form-item label="语文分数">
          <el-input v-model="form.score[0]" />
      </el-form-item>
      <el-form-item label="数学分数">
          <el-input v-model="form.score[1]" />
      </el-form-item>
      <el-form-item label="英语分数">
          <el-input v-model="form.score[2]" />
      </el-form-item>
      

      <el-form-item>
          <el-button type="primary" @click="onSubmit">添加</el-button>
          <el-button @clicl="onCancel">取消</el-button>
      </el-form-item>
  </el-form>
  
</template>
<script setup>
import { defineModel } from "vue";
const form = defineModel({
  form:Object
});

// 输入完成后将form的值传递给stus
// stus.push(form)完成更新
</script>